using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using UnityEngine.UI;

public class score_text : MonoBehaviour
{   public int Enemynumber = 0 ;
    private GameObject[] gos;
    private Text m_Text;
    // Start is called before the first frame update
    void Start()
    {
        m_Text = GetComponent<Text>();
        
    }

    // Update is called once per frame
    void Update()
    {
        gos = GameObject.FindGameObjectsWithTag("Enemy");
        Enemynumber = gos.Length;
        if(Enemynumber!=0){
            m_Text.text = Enemynumber.ToString();
        }
        else
        {
            m_Text.text = "0, 已胜利！";
        }
    }
}
